import logging
import unittest

from common.logging_use import init_log_config
from config import BASE_DIR
from scripts.test_tpshop_login_params import TestTpshopLoginParams

# 初始化日志信息
init_log_config(BASE_DIR + "/log/tpshop.log")

# 创建测试套件实例,suite
suite = unittest.TestSuite()

# print("测试套件实例创建成功")
logging.info("测试套件实例创建成功")

from htmltestreport import HTMLTestReport

# 添加测试类
suite.addTest(unittest.makeSuite(TestTpshopLoginParams))

# 创建HTMLTestreport类实例,runner
runner = HTMLTestReport(BASE_DIR + "/report/tpshopLogin测试报告.html")
# runner = HTMLTestReport("./report/tpshopLogin测试报告.html")

# runner调用run(),传入suite
runner.run(suite)
# print("测试报告生成成功")
logging.info("测试报告生成成功")